﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace Quarto
{
    public class Piece : Microsoft.Xna.Framework.Game
    {
        public enum Couleur { Rouge, Bleu };
        public enum Taille { Grand, Petit };
        public enum Trou { Oui, Non };
        public enum Forme { Carré, Rond };

        private Couleur couleur_piece;
        private Taille taille_piece;
        private Trou trou_piece;
        private Forme forme_piece;
        private Sprite sprite;
        private bool pose;

        public Couleur Couleur_piece
        {
            get { return couleur_piece; }
            set { couleur_piece = value; }
        }
        public Taille Taille_piece
        {
            get { return taille_piece; }
            set { taille_piece = value; }
        }
        public Trou Trou_piece
        {
            get { return trou_piece; }
            set { trou_piece = value; }
        }
        public Forme Forme_piece
        {
            get { return forme_piece; }
            set { forme_piece = value; }
        }
        internal Sprite Sprite
        {
            get { return sprite; }
            set { sprite = value; }
        }
        public bool Pose
        {
            get { return pose; }
            set { pose = value; }
        }
        public Piece()
        {
        }

        public Piece(Couleur c, Taille t, Trou tr, Forme f, Texture2D text, int x, int y, int taille)
        {
            this.couleur_piece = c;
            this.taille_piece = t;
            this.trou_piece = tr;
            this.forme_piece = f;
            this.sprite = new Sprite(text, x, y);
            this.sprite.Dimentions.Width = taille;
            this.sprite.Dimentions.Height = taille;
        }

        /// <summary>
        /// Allows the game component to perform any initialization it needs to before starting
        /// to run.  This is where it can query for any required services and load content.
        /// </summary>
        protected override void Initialize()
        {

        }

        protected override void LoadContent()
        {
        }

        /// <summary>
        /// UnloadContent will be called once per game and is the place to unload
        /// all content.
        /// </summary>
        protected override void UnloadContent()
        {
        }

        /// <summary>
        /// This is called when the game should draw itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        public void Draw(GameTime gameTime, SpriteBatch spriteBatch)
        {
            this.sprite.Draw(spriteBatch, this.sprite.Dimentions.Width);
            base.Draw(gameTime);
        }
    }
}
